package ModelLayer;


/**
 * Write a description of class CurrentAccount here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class CurrentAccount
{
    
    private static CurrentAccount instance = new CurrentAccount();
    private static StaffMember account;

    
    
    
    public static CurrentAccount get_instance()
    {
        return instance;
    }
    
    /**
     * Constructor for objects of class CurrentAccount
     */
    protected CurrentAccount()
    {

    }

    public static boolean change_account(StaffMember new_account)
    {
        if (new_account != null)
        {
            account = new_account;
            return true;
        }
        return false;
    }
    
    public static String give_rank()
    {
    	return account.give_rank();
        
    }
    
    public static boolean check_password(String password)
    {
        return (account.get_password().equals(password));
    }
    
    public static String view_account()
    {
        return account.printable();
    }
    
    public static void change_password(String new_password)
    {
        account.set_password(new_password);
    }
    
    public static void change_login(String new_login)
    {
        account.set_login(new_login);
    }
    
    public static String get_id()
    {
    	return account.get_id();
    }
    
    public static void change_account_data(String name, String phone_nr, String address, String postal_code, String city)
    {
        account.set_name(name);
        account.set_phone_nr(phone_nr);
        account.set_address(address);
        account.set_postal_code(postal_code);
        account.set_city(city);
    }
    
    
    public static void add_new_serviced_order(String id)
    {
        account.add_new_serviced_order(id);
        account.increase_total_sales(OrderCollection.provide_total_cost_of_order(id));
    }
        
}
